float4x4 g_mProj : Projection;
float2 g_vViewportProj;
float4x4 g_mWorld;

void V_DebugLine(	float4 vPos : POSITION,
						float4 vColor : COLOR0,
						out float4 oColor : COLOR0,
						out float4 oPos : POSITION )
{
	//oPos = mul( vPos, g_mProj );
	vPos = mul( vPos, transpose(g_mWorld) );
	vPos.xy -= 0.5f;
	float2 vTmp = float2((vPos.x + g_mWorld[3][0]) * g_vViewportProj.x, (-vPos.y-g_mWorld[3][1]) * g_vViewportProj.y);
	oPos = float4( vTmp.x*2.f-1.f, vTmp.y*2.f+1.f, vPos.z, 1.f );
    oColor = vColor;
}

float4 F_DebugLine( float4 oColor : COLOR0 ) : COLOR0
{
    return oColor;
}

technique DebugLine
{
    pass P0
    {
		ZEnable = false;
        VertexShader = compile vs_2_0 V_DebugLine();
        PixelShader  = compile ps_2_0 F_DebugLine();
    }
}
